'use strict';

const Service = require('egg').Service;

class GoodsEvalService extends Service {
    // 评价商品
    async evalGoods(payload) {
        const { ctx } = this;
        const {userId, orderId, goods} = payload;
        for (const item of goods) {
            const { image, rate, content, name, imgFiles, goodsId } = item;
            await ctx.model.GoodsEval.create({ userId, orderId, image, rate, content, name, imgFiles, goodsId })
        }
    }
}

module.exports = GoodsEvalService;
